//    this is js document
function changeView(){
	var keywords = window.parent.document.getElementById("keyWords");
	keywords.value = "";
	search();
}
function search(){
	var rightIframe = document.getElementById("rightIframe");
	rightIframe.src = "/networkforum/pages/article/article_list.html";
}
function listInit(datas){
	//var datas = eval("("+d+")");
	var ul = document.getElementById("listInner");
	if(datas == null || datas == ""){
		var label = document.createElement("label");
		label.innerHTML = "没有搜索到类似内容！";
		ul.appendChild(label);
		if(window.parent.iFrameHeight)
			window.parent.iFrameHeight("rightIframe");
		return;
	}
	var frag = document.createDocumentFragment();
	for(var i =0;i<datas.length;i++){
		var data = datas[i];
		var li = document.createElement("li");
		var title = document.createElement("h2");
		var publishTime = document.createElement("label");
		var visitTime = document.createElement("label");
		var replyTime = document.createElement("label");

		title.innerHTML = data.articleTitle;
		publishTime.innerHTML = data.publishTime;
		visitTime.innerHTML = " 访问次数("+data.visitTime+")";
		replyTime.innerHTML = " 评论次数("+data.replyTime+")";

		li.appendChild(title);
		li.appendChild(publishTime);
		li.appendChild(visitTime);
		li.appendChild(replyTime);
		//记录博客ID
		title.articleId = data.articleId;

		frag.appendChild(li);
		title.onclick = function(event){
			var event = event || window.event;
			var target = event.target;
			
			var articleId = window.parent.document.getElementById("articleId");
			articleId.value = target.articleId;
			var url = "/networkforum/pages/article/article_content.html";
			window.parent.document.getElementById("rightIframe").src = url;
		}
	}
	ul.appendChild(frag);
	if(window.parent.iFrameHeight)
		window.parent.iFrameHeight("rightIframe");
}